package view;

import java.awt.Color;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.net.URL;

import javax.swing.AbstractAction;
import javax.swing.AbstractButton;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JMenuItem;

import accounts.Authorization;
import controller.*;

public class EnvironmentConfigDesignerPanel extends MainPanel{
	private JButton newEnvConfigBtn, openBtn, saveBtn, copyBtn, deleteBtn, reportBtn;
	private JButton submitBtn, approveBtn;
	private JButton newNodeBtn, newChannelBtn, deleteNodeBtn, deleteChannelBtn;
	

	private JMenuItem menuItem_New, menuItem_Open, menuItem_Save, menuItem_Copy, menuItem_Delete, menuItem_Report, menuItem_Submit;
	private JMenuItem menuItem_SimMode, menuItem_SecurityMode;

	
	public EnvironmentConfigDesignerPanel(){
		super();
	}
	
	public void setupMenuBar(){
		if((authorization == Authorization.ADMINISTRATOR) 
				|| (authorization == Authorization.ENGINEER)) {
			menuItem_New = new JMenuItem();
			toolbar.setAction(menuItem_New, "New", null);
			menuFile.add(menuItem_New);
		}
		
		menuItem_Open = new JMenuItem();
		toolbar.setAction(menuItem_Open, "Open", null);
		menuFile.add(menuItem_Open);
		
		menuItem_Save = new JMenuItem();
		toolbar.setAction(menuItem_Save, "Save", null);
		menuFile.add(menuItem_Save);
		
		menuItem_Copy = new JMenuItem();
		toolbar.setAction(menuItem_Copy, "Copy", null);
		menuFile.add(menuItem_Copy);
		
		menuItem_Delete = new JMenuItem();
		toolbar.setAction(menuItem_Delete, "Delete", null);
		menuFile.add(menuItem_Delete);
		
		menuItem_Report = new JMenuItem();
		toolbar.setAction(menuItem_Report, "Report", null);
		menuFile.add(menuItem_Report);
		
		menuItem_Submit = new JMenuItem();
		toolbar.setAction(menuItem_Submit, "Submit", null);
		menuFile.add(menuItem_Submit);
		
		if(authorization == Authorization.ADMINISTRATOR) {
			menuItem_SimMode = new JMenuItem();
			toolbar.setAction(menuItem_SimMode, "Simulation Mode", null);
			menuMode.add(menuItem_SimMode);
			
			menuItem_SecurityMode = new JMenuItem();
			toolbar.setAction(menuItem_SecurityMode, "Security Mode", null);
			menuMode.add(menuItem_SecurityMode);
		}
	}
	
	
	public void setupToolbar(){
		//toolbarPanel.add
		if((authorization == Authorization.ADMINISTRATOR) 
				|| (authorization == Authorization.ENGINEER)) {
			newEnvConfigBtn = toolbar.makeButton("new", "New");
			toolbar.add(newEnvConfigBtn);
		}
		
		openBtn = toolbar.makeButton("open", "Open");
		toolbar.add(openBtn);
		
		saveBtn = toolbar.makeButton("save", "Save");
		toolbar.add(saveBtn);
		
		copyBtn = toolbar.makeButton("copy", "Copy");
		toolbar.add(copyBtn);
		
		deleteBtn = toolbar.makeButton("delete", "Delete");
		toolbar.add(deleteBtn);
		
		reportBtn = toolbar.makeButton("report", "Report");
		toolbar.add(reportBtn);
		
		submitBtn = toolbar.makeButton("submit", "Submit");
		toolbar.add(submitBtn);
		
		toolbar.addSeparator();
		//approveBtn = makeButton("approve", "Approve Environment Configuration");
		//toolbar.add(approveBtn);
		
		newNodeBtn = toolbar.makeButton("node", "Add Node");
		toolbar.add(newNodeBtn);
		
		newChannelBtn = toolbar.makeButton("channel", "Add Channel");
		toolbar.add(newChannelBtn);
		
		deleteNodeBtn = toolbar.makeButton("deleteNode", "Delete Node");
		toolbar.add(deleteNodeBtn);
		
		deleteChannelBtn = toolbar.makeButton("deleteChannel", "Delete Channel");
		toolbar.add(deleteChannelBtn);
		
		toolbar.addSeparator();
		toolbar.setupNodeGroupButtons();
	}
	
	public void setupCanvasPanel(){

	}
	public void setupAttributesPanel(){
		
	}
	
}
